home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / IEditor / Include / expanders.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-17  |  5.6 KB  |  173 lines

  1. #ifndef IEDIT_EXPANDER_H
  2. #define IEDIT_EXPANDER_H
  3. /*
  4. **      Interface Editor expanders definitions.
  5. **
  6. **      (C) Copyright 1996 Simone Tellini
  7. **          All Rights Reserved
  8. */
  9.  
  10. #ifndef INTUITION_INTUITION_H
  11. #include <intuition/intuition.h>
  12. #endif
  13.  
  14. #ifndef IEDIT_IEDIT_H
  15. #include "DEV_IE:Include/IEditor.h"
  16. #endif
  17. #ifndef IEDIT_GENERATOR_H
  18. #include "DEV_IE:Include/generatorlib.h"
  19. #endif
  20.  
  21.  
  22.  
  23. /*********************
  24. **   ExpanderBase   **
  25. *********************/
  26.  
  27. struct Expander {
  28.     struct Library          Lib;
  29.     struct Node             Node;       /* node displayed in the Add   */
  30.                         /* Gadget list                 */
  31.     UBYTE                   Kind;       /* Kind of expander. See below */
  32.     UBYTE                   Resizable;  /* can this object be resized? */
  33.     UBYTE                   Movable;    /* can we be moved?            */
  34.     UBYTE                   HasItems;   /* has items (like MX_KIND)?   */
  35.     UBYTE                   UseFonts;   /* we use a font?              */
  36.     UBYTE                   Reserved;   /* for future use              */
  37.     UWORD                   Width;      /* fixed size. Used when       */
  38.     UWORD                   Height;     /* Resizable = FALSE;          */
  39. };
  40.  
  41.  
  42. /*************************
  43. **  Expander Kinds      **
  44. *************************/
  45.  
  46. #define IEX_OBJECT_KIND     0       /* we add objects                      */
  47. #define IEX_ATTRIBUTE_KIND  1       /* doesn't add objects, just attributes*/
  48. #define IEX_AREXX_KIND      2       /* adds just ARexx commands            */
  49. #define IEX_BOOPSI_KIND     3       /* adds BOOPSI objects                 */
  50.  
  51.  
  52. /************************
  53. **  BOOPSI Expanders   **
  54. ************************/
  55.  
  56. struct BOOPSIExp {
  57.     struct Expander IEX;
  58.     struct MinList  Tags;       /* list of BOOPSITag items      */
  59.     UBYTE           BOOPSIType; /* see below                    */
  60. };
  61.  
  62. /*  BOOPSI type */
  63.  
  64. #define BT_GADGET   0
  65. #define BT_IMAGE    1
  66.  
  67.  
  68. struct BOOPSITag {
  69.     struct BOOPSITag   *Succ;
  70.     struct BOOPSITag   *Pred;
  71.     UBYTE               Type;   /* see below                    */
  72.     UBYTE               Reserved;   /*  *** DON'T TOUCH !!! *** */
  73.     STRPTR              Name;   /* ti_Tag name                  */
  74.     ULONG               Value;  /* ti_Tag value                 */
  75.     struct MinList      Items;  /* possible values for this tag */
  76. };
  77.  
  78.  
  79. /*  Tag types   */
  80.  
  81. #define TT_BYTE             0
  82. #define TT_WORD             1
  83. #define TT_LONG             2
  84. #define TT_BYTE_PTR         3       /* ptr to byte or to array of bytes */
  85. #define TT_WORD_PTR         4
  86. #define TT_LONG_PTR         5
  87. #define TT_STRING           6
  88. #define TT_STRING_ARRAY     7
  89. #define TT_STRING_LIST      8
  90. #define TT_BOOL             9
  91. #define TT_CHOOSE          10       /* choose the value from the list   */
  92. #define TT_OBJECT          11       /* pointer to another BOOPSI object */
  93. #define TT_USER_STRUCT     12       /* pointer to an user structure     */
  94. #define TT_SCREEN          13       /* pointer to the screen used       */
  95.  
  96.  
  97.  
  98. /************************
  99. **  Objects structure  **
  100. ************************/
  101.  
  102. /*
  103.     This is the standard object structure. If your object should appear
  104.     as any other IE gadget, then it MUST use a structure whose fields
  105.     match these. Anyway, if your object has set Resizable = FALSE,
  106.     Movable = FALSE and HasItems = FALSE, you can change the structure
  107.     as you want, provided that the first three fields (o_Node, o_Kind,
  108.     o_Flags) aren't taken away, otherwise IE could wonder what sort of
  109.     object it has found in its list... ;-)
  110.  
  111.     NOTE WELL: the o_Node.ln_Type field is NOT to be touched by the
  112.            expander!
  113. */
  114.  
  115. struct ObjectInfo {
  116.     struct  Node o_Node;
  117.     UWORD   o_Kind;         /* fill with the ID passed by IE    */
  118.     UBYTE   o_Flags;        /* used by IE                       */
  119.                 /* you can only check the G_ATTIVO  */
  120.                 /* bit (means that this object is   */
  121.                 /* selected)                        */
  122.     UBYTE   o_Key;          /* if you're object has a selection */
  123.                 /* key you must put it here and     */
  124.                 /* increment the wi_NumKeys field   */
  125.                 /* of the gadget's window info      */
  126.     struct TxtAttrNode *o_Font; /* if your object supports fonts*/
  127.                 /* here you'll find a ptr to a      */
  128.                 /* TxtAttrNode structure when the   */
  129.                 /* user selects Gadgets/Font...     */
  130.     UBYTE   o_Title[80];    /* title  */
  131.     UBYTE   o_Label[40];    /* label  */
  132.     APTR    o_User1;        /* use it as you like               */
  133.     WORD    o_Left;         /* this fields are updated by IE if */
  134.     WORD    o_Top;          /* your object is resizable/movable */
  135.     UWORD   o_Width;
  136.     UWORD   o_Height;
  137.     APTR    o_User2;        /* all these fields are for your    */
  138.     APTR    o_User3;        /* use. If your object doesn't have */
  139.     WORD    o_User4;        /* items (HasItems = FALSE) and you */
  140.     APTR    o_User5;        /* don't need these fields, then    */
  141.     APTR    o_User6;        /* allocate a shorter structure ;-) */
  142.     APTR    o_User7;        /* But if you're object has items,  */
  143.     APTR    o_User8;        /* you'll have to allocate them even*/
  144.     APTR    o_User9;        /* if it's just a waste of memory,  */
  145.     ULONG   o_User10[7];    /* for compatibility... :-|         */
  146.     UWORD   o_NumItems;     /* num items if HasItems = TRUE     */
  147.     struct MinList o_Items; /* item list                        */
  148. };
  149.  
  150.  
  151.  
  152. /******************
  153. **  Descriptors  **
  154. ******************/
  155.  
  156. struct Descriptor {
  157.     UBYTE   Key;        /* character following '%' */
  158.     STRPTR  Meaning;    /* the string that must be put instead of */
  159.                 /* the formatting code                    */
  160. };
  161.  
  162.  
  163. /******************
  164. **  Error codes  **
  165. ******************/
  166.  
  167.  
  168. #define IEX_OK                  0
  169. #define IEX_ERROR_NO_DESC_FILE  1   /* source descriptor file not found   */
  170.  
  171.  
  172. #endif  /*  IEDIT_EXPANDER_H  */
  173.